package top.lingkang.finalgateway.admin.entity;

import lombok.Data;
import top.lingkang.mm.annotation.Column;
import top.lingkang.mm.annotation.PostUpdate;
import top.lingkang.mm.annotation.PreUpdate;

import java.util.Date;

/**
 * @author lingkang
 * Created by 2024/4/28
 */
@Data
public class BaseTime {
    @Column("create_time")
    private Date createTime;
    @Column("update_time")
    private Date updateTime;

    @PreUpdate
    public void preUpdate() {
        updateTime = new Date();
        if (createTime == null)
            createTime = updateTime;
    }
}
